﻿using FruitVentDesign.Enums;
using FruitVentDesign.Utils;
using FruitVentDesignDemo.View;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;

namespace FruitVentDesignDemo
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : FruitVentDesign.Windows.Window
    {
        /// <summary>
        /// 窗体主题颜色
        /// </summary>
        public ThemeKind CurrenTheme { get; set; }
        private Dictionary<string, Page> pages = new Dictionary<string, Page>();

        public MainWindow()
        {
            InitializeComponent();
            switch (FruitVentDesign.Configurations.Cinfiguration.ThemeColor)
            {
                case "Blue":
                    ThemeAssist.ChangeTheme(ThemeKind.Blue);
                    CurrenTheme = ThemeKind.Blue;
                    break;
                default:
                    break;
            }

            pages.Add("Button", new ButtonPage());
            pages.Add("CheckBox", new CheckBoxPage());
            pages.Add("Radio", new RadioPage());
            pages.Add("Input", new InputPage());
            pages.Add("Select", new SelectPage());
            pages.Add("TreeSelect", new TreeSelectPage());
            pages.Add("DatePicker", new DatePickerPage());
            pages.Add("Form", new FormPage());
            pages.Add("Tree", new TreePage());
            pages.Add("Table", new TablePage());
            // pages.Add("Menu", new MenuPage());
            pages.Add("FunctionalWindow", new FunctionalWindowPage());

            mainFrame.Navigate(pages["Button"]);
        }

        private void SwitchPage_Click(object sender, RoutedEventArgs e)
        {
            if(sender is FruitVentDesign.Controls.Button btn)
            {
                mainFrame.Navigate(pages[btn.Content.ToString()]);
            }
        }
    }
}
